#ifndef BERNSTEINPOLYLINE_H
#define BERNSTEINPOLYLINE_H

#include <QObject>
#include <QVector3D>
#include <QMatrix4x4>
#include "matrix.h"
#include "curven.hpp"

typedef PolygonalCurve<float, 3> Curve3D;
typedef PolygonalCurve<float, 2> Curve2D;

typedef VectorN<float, 3> Vector3D;
typedef VectorN<float, 2> Vector2D;

typedef PointN<float, 3> Point3D;
typedef PointN<float, 2> Point2D;

class BernsteinPolyLine : public QObject
{
    Q_OBJECT

    Matrix m;
public:
    explicit BernsteinPolyLine(QObject *parent = 0);

    bool bindControlPoints(const Curve3D&);

    Curve3D getPolyLine(float step = 0.025);

    Point3D getPoint(float t);

signals:

public slots:

};

template<unsigned int ndim>
QDebug operator<<(QDebug dbg, const PointN<float, ndim> &p);

QDebug operator<<(QDebug dbg, const Curve3D &curve);

#endif // BERNSTEINPOLYLINE_H
